package zaphod.project1.editparts;

import java.util.List;

import org.eclipse.draw2d.FlowLayout;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Layer;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;

import zaphod.project1.model.internal.Document;

public class DocumentEditPart extends AbstractGraphicalEditPart
{
    @Override
    protected IFigure createFigure()
    {
        FlowLayout manager;
        Layer figure;

        manager = new FlowLayout();
        figure = new Layer();

        manager.setHorizontal( false );
        manager.setMajorSpacing( 10 );
        manager.setMajorAlignment( FlowLayout.ALIGN_CENTER );

        figure.setLayoutManager( manager );

        return figure;
    }

    private Document getCastedModel()
    {
        return (Document) getModel();

    }

    @Override
    protected void createEditPolicies()
    {
        // TODO Auto-generated method stub

    }

    @SuppressWarnings( "unchecked" )
    @Override
    protected List getModelChildren()
    {
        return getCastedModel().getChildren();
    }

}
